package com.example.pruebaHttp;
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
 
@SuppressWarnings("deprecation")
public class TabBar extends TabActivity /*implements OnTabChangeListener*/{
 
    /** Called when the activity is first created. */
      TabHost tabHost;
       
      @Override
      public void onCreate(Bundle savedInstanceState) {
    	  
          super.onCreate(savedInstanceState);
  		  requestWindowFeature(Window.FEATURE_NO_TITLE);

          setContentView(R.layout.tab_bar_main);
           
          // Get TabHost Refference
          tabHost = getTabHost();
          // Set TabChangeListener called when tab changed
          //tabHost.setOnTabChangedListener(this);
          Resources res = getResources();
          TabHost.TabSpec spec;
          Intent intent;
     
           /************* TAB1 ************/
          // Create  Intents to launch an Activity for the tab (to be reused)
          intent = new Intent().setClass(this, DatosPagina.class);
          spec = tabHost.newTabSpec("First").setIndicator("",res.getDrawable(R.drawable.basic_info))
                  .setContent(intent);
          //Add intent to tab
          tabHost.addTab(spec);
     
          /************* TAB2 ************/
          intent = new Intent().setClass(this, RecentGamesActivity.class);
          spec = tabHost.newTabSpec("Second").setIndicator("",res.getDrawable(R.drawable.recent_games))
                        .setContent(intent);  
          tabHost.addTab(spec);
     
          /************* TAB3 ************/
          intent = new Intent().setClass(this, RankedStatsActivity.class);
          spec = tabHost.newTabSpec("Third").setIndicator("", res.getDrawable(R.drawable.ranked_info))
                  .setContent(intent);
          tabHost.addTab(spec);
          tabHost.getTabWidget().setStripEnabled(false);
          tabHost.getTabWidget().getChildTabViewAt(0).setBackgroundDrawable(null);
          tabHost.getTabWidget().getChildTabViewAt(1).setBackgroundDrawable(null);
          tabHost.getTabWidget().getChildTabViewAt(2).setBackgroundDrawable(null);
          tabHost.setCurrentTab(0);
       }
  
}